<page-header [title]="'明细查询'" [action]="actionTpl">
<ng-template #actionTpl>
    <button nz-button nzType="default" (click)="export()">导出</button>
    <button nz-button nzType="primary" (click)="getData()">查询</button>
    <button nz-button nzType="default" (click)="reset()">重置</button>
    <button nz-button nzType="primary" 
    nz-popover
    nzPopoverPlacement="left"
    [nzPopoverContent]="contentTemplate"
    nzPopoverTrigger="click"
    [(nzVisible)]="popvisible"
    >条件保存</button>
    <button nz-button nzType="default" (click)="open()">条件查询</button>
</ng-template>

</page-header>
<nz-card>
 
  <ng-template #contentTemplate>
      <textarea #text rows="4" nz-input placeholder="填写备注"  ></textarea>
      <button nz-button (click)="save(text.value)"> 保存 </button>
    </ng-template>
  <form nz-form [nzLayout]="'inline'" (ngSubmit)="getData()" class="search__form">
    <div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
      <sf #sf [schema]="schema" [button]="null" [formData] = "formData" >
     
      </sf>
      <div nz-col  >
          <a (click)="expand()">
            {{ expandForm ? '收起' : '展开' }}
            <i nz-icon [nzType]="expandForm ? 'up' : 'down'"></i>
          </a>
        </div>
    </div>

  </form>
</nz-card>

<nz-card>
    <!-- <nz-modal
      [(nzVisible)]="isVisible"
      nzTitle="明细"
      (nzOnCancel)="handleCancel()"
      (nzOnOk)="handleCancel()"
      nzWidth =1000
      nzCancelText = null
      nzClosable = false
    > -->
    <ng-template #tplContent>
    <nz-tabset >
      <nz-tab nzTitle="项目汇总" >
        <div *ngIf="stvisible">
          <lb-grid [columns]="columns1" [sname] = "params.summary" [queryparas]="params.form"  ></lb-grid>
        </div>
      </nz-tab>
      <nz-tab nzTitle="费用详情" >
        <div *ngIf="stvisible">
          <lb-grid [columns]="columns2" [sname] = "params.cost" [queryparas]="params.form"[scroll]="{x: '2300px'}"  ></lb-grid>
        </div>
      
      </nz-tab>
      <nz-tab nzTitle="基金分类"
       (nzClick)="fundClick($event)"
       
        (nzDeselect) ="DeselectFund($event)"
        >
        <div *ngIf="stvisible">
          <lb-grid #stfund [columns]="columns3" [sname] = "params.fund" [queryparas]="params.form"  ></lb-grid>
        
        </div> 
        <div style="height:210px;width:50%;  margin: auto;">
        
        <g2-pie
        [hasLegend]="true"
        title="基金总额"
        subTitle="基金总额"
        [total]="fund.total"
        [valueFormat]="fund.format"
        [data]="fundPieData"
        height="200"
  
        *ngIf="fundvisible"
        ></g2-pie>
        </div>
     
      </nz-tab>
      <nz-tab nzTitle="费用分类"
      (nzClick)="costClick($event)"
       
        (nzDeselect) ="DeselectCost($event)">
        <div *ngIf="stvisible">
          <lb-grid  #costst [columns]="columns4" [sname] = "params.CostClassification" [queryparas]="params.form" ></lb-grid>
        </div>
        <!-- <div style="height:210px;width:50%;  margin: auto;">
        
          <g2-pie
          [hasLegend]="true"
          title="费用总额"
          subTitle="费用总额"
          [total]="cost.total"
          [valueFormat]="cost.format"
          [data]="costPieData"
          height="200"
    
          *ngIf="costvisible"
          ></g2-pie>
         
          </div> -->
          <!-- <g2-custom
          *ngIf="costvisible"
          (render)="render($event)"
          
          ></g2-custom
          > -->
          <!-- <lb-stack-pie 
          *ngIf="costvisible"
          height='400' stackPie='44'
          [data]="demoData"
          ></lb-stack-pie> -->
          <div class="container">
             <cx-stack-pie *ngIf="costvisible" height="300" [data]="costPieData"></cx-stack-pie>
          </div>
         
      </nz-tab>
      <nz-tab nzTitle="疾病分类">
        <div *ngIf="stvisible">
          <lb-grid [columns]="columns5" [sname] = "params.disease" [queryparas]="params.form" ></lb-grid>
        </div>
         
      </nz-tab>
    </nz-tabset>
  </ng-template>
    <lb-grid #st [columns]="columns" [sname] = "params.query" [scroll]= "{x: '2300px'}" [queryparas]="para" ></lb-grid>
</nz-card>
      <nz-drawer
      [nzClosable]="false"
      [nzVisible]="drvisible"
      nzPlacement="right"
      nzTitle="查询条件"
      (nzOnClose)="close()"
      >
      <nz-list
      [nzLoading]="loading"
      [nzDataSource]="list"
      [nzRenderItem]="item"
      [nzGrid]="{ gutter: 24, lg: 24, md: 12, sm: 24, xs: 24 }"
      >
   
<ng-template #item let-item   let-i="index">
      <nz-list-item>
    <nz-card nzHoverable *ngIf="item !== null"  >
          <a (click)="assignsf(item)">{{ item.CZE041 }}</a>  
          <a
           style="float: right;" 
         
           nz-popconfirm
           nzPopconfirmTitle="确认要删除么?"
           nzPopconfirmPlacement="bottom"
           (nzOnConfirm)="deleteCondition(i)"
           >
           <i nz-icon nzType="delete" nzTheme="outline"></i>
           </a>
         
          <ellipsis (click)="assignsf(item)">{{ item.CZE043 }}</ellipsis> 
          <label  nz-radio [ngModel]="item.CZE044 ==='0'? false :true " style="position: absolute;    left: 140px;
          top: 60px;"
          (click)="shareChange(i)"
          >分享</label> 
    </nz-card>
  </nz-list-item>
</ng-template>
</nz-list>
</nz-drawer>
